package com.todod.base.module.infra.dal.mysql.basecarousel;

import java.util.*;

import com.todod.base.framework.common.pojo.PageResult;
import com.todod.base.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.todod.base.framework.mybatis.core.mapper.BaseMapperX;
import com.todod.base.module.infra.dal.dataobject.basecarousel.BaseCarouselDO;
import org.apache.ibatis.annotations.Mapper;
import com.todod.base.module.infra.controller.admin.basecarousel.vo.*;

/**
 * 轮播图管理 Mapper
 *
 * @author 平台管理员
 */
@Mapper
public interface BaseCarouselMapper extends BaseMapperX<BaseCarouselDO> {

    default PageResult<BaseCarouselDO> selectPage(BaseCarouselPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BaseCarouselDO>()
                .eqIfPresent(BaseCarouselDO::getPtType, reqVO.getPtType())
                .eqIfPresent(BaseCarouselDO::getLocationType, reqVO.getLocationType())
                .likeIfPresent(BaseCarouselDO::getCreator, reqVO.getCreator())
                .betweenIfPresent(BaseCarouselDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BaseCarouselDO::getId));
    }

}